import service from '@/utils/https';
import type { API } from '@/utils/api';

/**
 * 场地模块 - 查询场地列表
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const getAreaList = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/venue/find-venue-list',
		method: 'get',
		params,
	})
}

/**
 * 场地模块 - 新增场地
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postAddArea = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/venue/save-venue',
		method: 'post',
		data: params,
	})
}

/**
 * 场地模块 - 更新场地
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postUpdateArea = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/venue/update-venue',
		method: 'post',
		data: params,
	})
}

/**
 * 场地模块 - 删除场地
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postDelArea = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/venue/delete-venue-by-id',
		method: 'post',
		data: params,
	})
}

/**
 * 场地模块 - 查询场馆场地映射关系
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const getVenueSiteList = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/venue/find-venue-site-mapping',
		method: 'get',
		params,
	})
}

/**
 * 场地模块 - 订单列表
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postOrderList = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/order/venue/find-order-venue-list',
		method: 'post',
		data: params,
	})
}

/**
 * 场地模块 - 订单总量列表
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postOrderSummaryList = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/order/venue/get-order-venue-summary-info',
		method: 'post',
		data: params,
	})
}

/**
 * 场地模块 - 创建订单
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postOrderCreate = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/order/venue/create-order-venue',
		method: 'post',
		data: params,
	})
}

/**
 * 场地模块 - 退款审核
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postOrderRefund = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/order/venue/update-order-venue-refund-status',
		method: 'post',
		data: params,
	})
}

/**
 * 场地模块 - 发票审核
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const postOrderInvoice = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/order/venue/update-order-venue-invoice-status',
		method: 'post',
		data: params,
	})
}

/**
 * 场地模块 - 查询发票详情
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const getInvoiceInfo = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/order/venue/get-order-venue-invoice-info',
		method: 'get',
		params,
	})
}

/**
 * 场地模块 - 查询每日场地详情
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const getVenueSiteInfo = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/venue/get-venue-site-info',
		method: 'get',
		params,
	})
}

/**
 * 场地模块 - 修改待支付订单金额
 * @param params 要传的参数值，非必传
 * @returns 返回接口数据
 */
export const modifyAreaOrderAmount = (params?: object): Promise<API.responseType> => {
	return service({
		url: 'system/rest/order/venue/modify-order-amount',
		method: 'post',
		data: params,
	})
}